#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1.01e6, MOD = 1e9 + 7;
int n, m, a[N];
inline int qmi(int a, int k = MOD - 2, int p = MOD)
{
    int res = 1 % p;
    while (k)
    {
        if (k & 1)
        {
            res = (int)res * a % p;
        }
        a = (int)a * a % p;
        k >>= 1;
    }
    return res;
}
class lcpsTree
{
public:
    lcpsTree(const vector<int> &data)
    {
        n = data.size();
        tree.resize(2 * n * 2);
        buildlcpsTree(data, 0, 0, n - 1);
    }

private:
    vector<int> tree;
    int n;
    void buildlcpsTree(const vector<int> &data, int node, int st, int ed)
    {
        if (st == ed)
        {
            tree[node] = data[st];
        }
        else
        {
            int mid = (st + ed) / 2;
            int left = 2 * node + 1;
            int right = 2 * node + 2;
            buildlcpsTree(data, left, st, mid);
            buildlcpsTree(data, right, st, mid);
            tree[node] = tree[left] + tree[right];
        }
    }
};
void quick_sort(int q[], int l, int r)
{
    if (l >= r)
        return;
    int i = l - 1, j = r + 1, x = q[l + r >> 1];
    while (i < j)
    {
        do
            i++;
        while (q[i] < x);
        do
            j--;
        while (q[j] > x);
        if (i < j)
            swap(q[i], q[j]);
    }
    quick_sort(q, l, j), quick_sort(q, j + 1, r);
}
int dfs(int u,int father,const vector<vector<int>> &g)
{
    int res=0;
    for(auto & v:g[u])
    {
        if(v==father)
        {
            continue;
        }
        res = max(res, dfs(u, v, g));
    }
    return res + 1;
}
signed main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n;
    cin >> n;
    vector<vector<int>> g(n);
    for (int i = 0; i < n-1;i++)
    {
        int u, v;
        cin >> u >>v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    int now = dfs(0, -1, g);
    vector<int> data = {1, 3, 5, 7, 9, 11};
    lcpsTree lcptree(data);
    int res = 0;
    bool f = 1;
    while (f)
    {
        vector<int> Cc;
        Cc = data;
        res = now * (now + 1);
        break;
    }
    cout << res / 2;
    return 0;
}